1 GUI.cocoa; // use CocoaGUI (Mac OS X native)
2 GUI.swing; // use SwingGUI (Java based GUI)
6 var size, win, data1, data2, view1, view2, swapData, data1Color, data2Color;
7 data1Color = Color.blue;
8 data2Color = Color.green;
10 data1 = {1.0.rand} ! size;
11 data2 = {1.0.rand} ! size;
13 win = Window("double multislider", Rect(200 , 450, 450, 150));
15 Button(win, Rect(0,0, 80,20)).states_([["green"],["blue"]])
16 .action_{|v| swapData.(v.value)};
18 swapData = {|dofocusOn|
22 view1 = MultiSliderView(win, Rect(0, 24, 350, 100))
23 .background_(Color.green(alpha:0.0))
24 .fillColor_(data1Color.alpha_(0.5))
29 .action_({|sl| data1 = sl.value;});
30 view2 = MultiSliderView(win, Rect(0, 24, 350, 100))
31 .background_(Color.green.alpha_(0.0))
32 .fillColor_(data2Color)
37 .action_({|sl| data2 = sl.value;});
39 view2 = MultiSliderView(win, Rect(0, 24, 350, 100))
40 .background_(Color.green(alpha:0.0))
41 .fillColor_(data2Color.alpha_(0.5))
46 .action_({|sl| data2 = sl.value;});
47 view1 = MultiSliderView(win, Rect(0, 24, 350, 100))
48 .background_(Color.green.alpha_(0.0))
49 .fillColor_(data1Color)
54 .action_({|sl| data1 = sl.value;});